if (window['ks']) {
    class Parser {
        constructor() {
            this._sdk = window['ks']
        }

        parse() {

            this._sdk.getGameRecorderManager = function () {
                return this._sdk.getGameRecorder()
            }
            let recorder = this._sdk.getGameRecorderManager()

            recorder.publish = function (param) {
                recorder.publishVideo(param)
            }
            recorder.onStart = function (func) {
                recorder.on('start', func)
            }
            recorder.onStop = function (func) {
                recorder.on('stop', func)
            }
            recorder.onResume = function (func) {
                recorder.on('resume', func)
            }
            recorder.onPause = function (func) {
                recorder.on('pause', func)
            }
            recorder.onError = function (func) {
                recorder.on('error', func)
            }
        }
    }
    new Parser().parse();
}